﻿using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace WcfInspectorLib
{
    public abstract class BaseMessageListener
    {
        private ServerMessageInspector _inspector;
        public ServerMessageInspector Inspector
        {
            get => _inspector;
            set
            {
                _inspector = value;
                if (value == null) return;
                value.AfterReceiveRequest += AfterReceiveRequest;
                value.BeforeSendReply += BeforeSendReply;
            }
        }

        public BaseMessageListener(ServerMessageInspector inspector)
        {
            Inspector = inspector;
        }

        public virtual void BeforeSendReply(object sender, BeforeSendReplyEventArgs e)
        {

        }

        public virtual void AfterReceiveRequest(object sender, AfterReceiveRequestEventArgs e)
        {

        }
    }
}
